<?php $this->load->module('mobile/index/header', $common);?>

<link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/template/default/mobile/css/main.css" />
<link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/template/default/mobile/css/dialog.css" />
<link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/template/default/mobile/css/base.css" />
<link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/template/default/mobile/css/index.css" />
<link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/template/default/mobile/css/line.css" />
<script type="text/javascript" src="<?php echo URLPRE;?>static/template/default/mobile/js/mobilecommon.js"></script>
<script type="text/javascript" src="<?php echo URLPRE;?>static/template/default/mobile/js/slider.js"></script>
<script type="text/javascript" src="<?php echo URLPRE;?>static/template/default/mobile/js/dialog.js"></script>
<div class="content">
    <div id="list">
            <a href="">
                <div class="list-item fn-clear">
                    <div class="info">
                        <h5><?php echo $flight_info['scityname'].'→'.$flight_info['ecityname'];?></h5>
                        <div class="i-note">
                            <p class="price">
                                <?php if (!empty($order_info['order_account'])) :?>
                                    ¥<?php echo intval($order_info['order_account']);?>
                                <?php endif; ?>
                            </p>
                            <p class="c_mt">订单编号：<?php echo $order_info['order_sn'];?></p>
                            <p class="c_mt">订单状态：<?php echo $order_info['order_status_name'];?></p>
                            <p class="c_mt">人数：<?php echo $flight_info['pcount'];?></p>
                            <p class="c_mt">乘机人：<?php echo $flight_info['pname'];?></p>
                            <p class="c_mt">证件号码：<?php echo $flight_info['pcard'];?></p>
                            <p class="c_mt">航班：<?php echo $flight_info['flight'];?></p>
                            <p class="c_mt">起飞时间：<?php echo $flight_info['stime'];?></p>
                            <p class="c_mt">落地时间：<?php echo $flight_info['etime'];?></p>
                            <p class="c_mt">出发机场：<?php echo $flight_info['sairport'];?></p>
                            <p class="c_mt">落地机场：<?php echo $flight_info['eairport'];?></p>
                            <p class="c_mt">出行时间：<?php echo $flight_info['date'];?></p>
                            <p class="c_mt">下单时间：<?php echo $order_info['add_time'];?></p>
                        </div>
                    </div>

                </div>
            </a>
    </div>

    <div class="col_div">

   <?php if($order_info['pay_status']==3&&$flight_server_info['Status']==2):?>
       <a href="javascript:void(0)" class="btn btn-orange" title="订单完成">订单完成</a>
   <?php endif;?>
        <?php if($order_info['order_status']==3):?>&nbsp;已关闭订单<?php endif;?>
        <?php if($order_info['pay_status']!=3&&$order_info['order_status']!=3&&!$flight_server_info['Status']):?>
            <a href="javascript:void(0)" class="btn btn-orange btn_pay" title="立即支付">立即支付</a>
        <?php endif;?>

        <?php if($order_info['order_status']!=3&&$order_info['pay_status']==1):?>
                <?php if($flight_server_info['Status']==0):?>
                    <a href="javascript:void(0)" class="btn btn-orange btn_cancel" title="立即取消">立即取消</a>
                <?php endif ;?>
            <?php endif ;?>


    </div>
</div>
<?php $this->load->module('mobile/index/footer', $common);?>
<script type="text/javascript">
    function alert_popup(text){
        $.dialog({
            style:'tip',
            width:200,
            closeTime:1000,
            content: '<p style="text-align: center">'+text+'</p>'
        }).open();
    }

    var order_id = '<?php  echo $order_info['order_id'];?>'  ;
    var order_sn = '<?php  echo $order_info['order_sn'];?>'  ;
    var pnr =      '<?php  echo $flight_info['pnr'];?>'  ;

    $(function(){
        var slid = $("#sliderimg").slider({
            loop: true
        });

        $('.btn_cancel').click(function(){

           $.post('<?php  echo $order_info['cancel_url'];?>',{
                   order_id:order_id
                 },function(data){
                           if(data.status=='1')
                           {
                               alert_popup(data.info);
                               window.location.reload();
                           }
                           alert_popup(data.info);
                 },'json')
        })

        $('.btn_pay').click(function(){

            $.post('<?php  echo $order_info['pay_url'];?>',{
                order_id:order_id,
                order_sn:order_sn,
                pnr:pnr
            },function(data){
                if(data.status=='1')
                {
                    window.location.href = data.info;
                }else{
                    alert_popup(data.info);
                }

            },'json')
        })

    });
</script>